<?php
/**
 * ScreenScraper
 * 
 * @package PHP2Workshop1
 * @author mj22pk
 * @copyright 2011
 */
class ScreenScraper implements iScreenScraper
{
    /**
     * ScreenScraper::DoScrap()
     * 
     * @return SimpleXMLElement
     */
    public function DoScrap($link)
    {
        $curlScraper = new CurlScraper();
        $scrapData = $curlScraper->DoScrapScreen($link);
        $xmlData = @simplexml_load_string($scrapData);//Interprets a string of XML into an object    
        if($xmlData != null)
        {
            $simpleXmlElement = new SimpleXmlElement($scrapData, LIBXML_NOCDATA); //Extracting CData from an SimpleXML object
      		return $simpleXmlElement;
        }
    }   
}